<html>

<head>
    <script>
        var flag = confirm("确认登录");
        if (flag == true) {
            console.log("确认登录")
        } else {
            console.log("登录失败")
        }
    </script>
</head>

<body>

</body>

</html>